package com.dizner.andandroidupdatetest

import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import com.dizner.androiduploadlibrary.UpTestGradeManager
import com.dizner.androiduploadlibrary.javabean.ApplicationUpdateInfoBean

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

    }

    private fun checkupdate() {

        val info = ApplicationUpdateInfoBean(getResources().getString(R.string.app_name) + "1.0.1", "1.0.1", 2, "更新描述", "http://img.jiaoyuchuang.com/20181217/b579a9cf-bcd4-4848-b7b9-2e902204368e.apk", "", false)
        UpTestGradeManager.getUpgrodeBuilder(this)
                .setIsAuto(true)
//                .setApkStorePath("ache/apk")
//                .setApkStorePath("/data/data/com.dizner.andandroidupdatetest/cache/apk")
                .setApplicationUpdateInfoBean(info)
                .build()
                .showUpgradeInfo()
    }

    override fun onResume() {
        super.onResume()
        checkupdate()
    }
}
